-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🔥AUDIT🔥] Fix GitHub workflow to check for release PRs #2367
Conversation
🦋 Changeset detectedLatest commit: 2812dac The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
GeraldRequired Reviewers
Don't want to be involved in this pull request? Comment |
npm Snapshot: NOT Published🤕 Oh noes!! We couldn't find any changesets in this PR (29963b8). As a result, we did not publish an npm snapshot for you. |
A new build was pushed to Chromatic! 🚀https://5e1bf4b385e3fb0020b7073c-xcvlprkkfu.chromatic.com/ Chromatic results:
|
Size Change: 0 B Total Size: 101 kB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thanks for investigating!
To test if it works sooner, we could add an empty changeset using yarn changeset --empty
so that when this PR gets merged, a changeset release PR is opened!
@beaesguerra thanks for the suggestion, but I now remember that creating empty changesets won't generate a new release PR. It was still worth trying :). https://github.com/Khan/wonder-blocks/actions/runs/11940885877/job/33284531353#step:5:14 |
@jandrade ah good to know, thanks for trying it out! |
Looks like Changeset PRs are still failing: https://github.com/Khan/wonder-blocks/actions/runs/11977720772/job/33397027198?pr=2368 |
@marcysutton yeah :(. I have another theory and it might be an issue with the |
🖍 This is an audit! 🖍
Summary:
There's an issue when a new Release Pull Request is created.
The problem is that one of the workflow job steps is failing because it cannot
find the base commit of the PR and it defaults to
00000000....00
instead.https://github.com/Khan/wonder-blocks/actions/runs/11937708116/job/33275169358#step:5:23
This has been temporarily solved by pushing an empty commit to the PR branch
which causes the branch/PR to have clean its state and have a base commit.
Possible cause:
My theory is that the PR/branch cannot determine the base commit because of the
way GH configures the COMMIT_SHA for this type of event (creating a PR/branch in
this case).
My thinking is that the base commit is not being fetched because the workflow
automatically creates a new branch so there's no commit to compare it to.
For reference: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#create
Solution:
This PR fixes the issue by adding a
fetch-depth
value to thecheckout
action inthe CI workflow. This will allow the workflow to fetch all the tags and commits
from the repository, so the base commit can be found.
Issue: XXX-XXXX
Test plan:
Verify that there are no PR check errors the next time the "Release PR" is
created (unfortunately, this is the only way to test these type of changes).